package com.tan.yebserver.utils;

import com.tan.yebserver.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @program: yeb
 * @description: 获取当前操作员
 * @author: Tan
 * @create: 2021-09-09 20:43
 **/
public class AdminUtils {

    /**
     * 获取当前操作员
     * @return
     */
    public static Admin getCurrentAdmin(){
        return (Admin) SecurityContextHolder.getContext()
                .getAuthentication().getPrincipal();
    }


}
